<?php
/**
 * Created by PhpStorm.
 * User: zoeyfRzr
 * Date: 2019/7/17
 * Time: 15:23
 */
$rote = isset($_GET['s']) ? trim($_GET['s']) : '';
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false ) {	
	$data = include 'data.php';
	include_once 'include.php';
	$domainArr = explode('.',$_SERVER['HTTP_HOST']);
	$short_redirect = $domainArr[1].'.'.$domainArr[2];
	if($short_redirect==$data['d4']){
		$newUrl = "http://".$data['d1']."/;cq100?_rad=".mt_rand(10000,99999);
		header("location:$newUrl");exit;
	}
	if (preg_match('/;cq100/', $rote, $matches)) {
		include 'mid.php';
	}elseif (preg_match('/;mid999/', $rote, $matches)) {
		include 'luodi.php';
	} else {
		exit('503');
	}
}else{
	exit('404');
}  
